package com.qijian.maindata.domain.enums;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum LedgerEnum {
    EQP("eqp", "设备"), FROCK("frock", "工装"), KNIFE("knife", "刀具"), WORKSHOP("workshop", "生产车间"), GAUGE("gauge", "量具"), TOOL("tool", "工具");

    @EnumValue
    @JsonValue
    private final String val;

    private final String label;

    public static LedgerEnum getEnumByVal(String val) {
        for (LedgerEnum item : LedgerEnum.values()) {
            if (StrUtil.equals(val, item.getVal())) {
                return item;
            }
        }
        return null;
    }


}
